Platform independence

In this part of the assignment, change your compiler to emit platform-independent code for IO.

To do so, follow the guidance from the class notes to:

\[ \begin{align} \Program \prod & \gt{printString} \STR \\ \alt & \gt{printNumber} \Expr \\ \\ \Expr \prod & \Expr \gt{+} \Expr \\ \alt & \Expr \gt{-} \Expr \\ \alt & \Expr \gt{*} \Expr \\ \alt & \gt{(} \Expr \gt{)} \\ \alt & \INT \end{align} \]

Note

This grammar is slightly different than the one presented in class. It has a different name for the instruction that prints a number. If you implemented the grammar from class, or another one close to it, that’s okay!

With these changes, the compiler no longer needs to return the result of the evaluated expression as part of sys_exit. If the end-user (i.e., the hmc programmer) wants to know the value of the expression, they now can print it!